package org.beehoo.web.daily.signin.dao;

import java.util.List;

import org.springframework.stereotype.Repository;

import org.beehoo.web.daily.usermanage.po.UserPO;
import org.beehoo.web.framework.dao.BaseDAO;

@Repository
public class SignInDAO extends BaseDAO {
	
	public UserPO getUser(String userName){
		String hql = "from UserPO u where u.userName = ?";
		List poList = this.getHibernateTemplate().find(hql, userName);
		if(poList.isEmpty() || poList.size() == 0){
			return null;
		}
		return (UserPO) poList.get(0);
	}
	
	public List<UserPO> getUserList(){
		String hql = "from UserPO";
		return this.getHibernateTemplate().find(hql);
	}
}
